<?php
namespace app\goods\model;

use app\common\library\Model;
use think\model\concern\SoftDelete;
class Goods extends Model
{
    protected $pk = 'goods_id';
    protected $append = [
    	'status_text',
    ];

    protected function getStatusTextAttr($value,$data)
    {
    	$type = ['0' => '下架', '1' => '上架'];
    	return $type[$data['status']];

    }

    //获取客户信息
    public function custom() {
        return $this->hasOne('app\\custom\\model\\Custom','current_id', 'current_id');
    }

    //获取站点信息
    public function site() {
        return $this->hasOne('app\\site\\model\\Site','id', 'site_id');
    }

}